<script type="text/javascript">
xe.lang.msg_empty_search_target = '{$lang->msg_empty_search_target}';
xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
</script>
<load target="js/file_admin.js" usecdn="true" />
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
	<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form id="fo_list" action="./" method="post" class="form">
	<input type="hidden" name="module" value="file" />
	<h1 class="h1">{$lang->file}</h1>
	<div class="table">
		<div class="cnb">
			<a href="{getUrl('', 'module', 'admin', 'act', 'dispFileAdminList')}" <!--@if($search_keyword == '')-->class="active"<!--@end-->>All</a>
			| <a href="{getUrl('search_target','isvalid','search_keyword','Y')}" <!--@if($search_target == 'isvalid' && $search_keyword == 'Y')-->class="active"<!--@end-->>{$lang->is_valid}</a>
			| <a href="{getUrl('search_target','isvalid','search_keyword','N')}" <!--@if($search_target == 'isvalid' && $search_keyword == 'N')-->class="active"<!--@end-->>{$lang->is_stand_by}</a>
		</div>
		<table width="100%" border="1" cellspacing="0" id="fileListTable">
			<caption>
				<!--@if($search_keyword == '')-->
				All
				<!--@elseif($search_target == 'isvalid' && $search_keyword == 'Y')-->
				{$lang->is_valid}
				<!--@elseif($search_target == 'isvalid' && $search_keyword == 'N')-->
				{$lang->is_stand_by}
				<!--@end-->
				({number_format($total_count)})
				<span class="side"><span class="btn"><a href="#listManager" class="modalAnchor" onclick="getFileList();">{$lang->file_manager}...</a></span></span>
			</caption>
			<thead>
				<tr>
					<th scope="col" class="text">{$lang->file}</th>
					<th scope="col" class="nowr">{$lang->file_size}</th>
					<th scope="col" class="nowr">{$lang->cmd_download}</th>
					<th scope="col" class="nowr">{$lang->author}</th>
					<th scope="col" class="nowr">{$lang->date}</th>
					<th scope="col" class="nowr">{$lang->ipaddress}</th>
					<th scope="col" class="nowr">{$lang->status}</th>
					<th scope="col"><input type="checkbox" data-name="cart" title="Check All" /></th>
				</tr>
			</thead>
			<tfoot>
				<tr>
					<th scope="col" class="text">{$lang->file}</th>
					<th scope="col" class="nowr">{$lang->file_size}</th>
					<th scope="col" class="nowr">{$lang->cmd_download}</th>
					<th scope="col" class="nowr">{$lang->author}</th>
					<th scope="col" class="nowr">{$lang->date}</th>
					<th scope="col" class="nowr">{$lang->ipaddress}</th>
					<th scope="col" class="nowr">{$lang->status}</th>
					<th scope="col"><input type="checkbox" data-name="cart" title="Check All" /></th>
				</tr>
			</tfoot>
			<tbody>
				<!--@foreach($file_list as $no => $val)-->
					<!-- one document start -->
					<!--@if($val->upload_target_srl != $cur_upload_target_srl)-->
						<!--@if($val->upload_target_type == 'com')-->
							{@ $document_srl = $val->target_document_srl}
							{@ $move_uri = getUrl('', 'document_srl', $document_srl).'#comment_'.$val->upload_target_srl}
						<!--@elseif($val->upload_target_type == 'doc')-->
							{@ $document_srl = $val->upload_target_srl}
							{@ $move_uri = getUrl('', 'document_srl', $document_srl)}
						<!--@end-->
						{@ $cur_upload_target_srl = $val->upload_target_srl}
				<tr>
					<th colspan="8" class="text" scope="col">
						<!--@if(!$val->upload_target_type)-->
							<!--@if($val->isvalid=='Y')-->
								{$lang->is_valid}
							<!--@else-->
								{$lang->is_stand_by}
							<!--@end-->
						<!--@else-->
							<!--@if($val->upload_target_type == 'com')-->[{$lang->comment}] <!--@end-->
							<!--@if($val->upload_target_type == 'mod')-->[{$lang->module}] <!--@end-->

							<!--@if($val->upload_target_type == 'doc' && $document_list[$document_srl] && $document_list[$document_srl]->get('module_srl') == $document_list[$document_srl]->get('member_srl'))-->[{$lang->cmd_temp_save}] <!--@end-->
							<!--@if($val->upload_target_type == 'doc' && $document_list[$document_srl] && $document_list[$document_srl]->get('module_srl') == 0)-->[{$lang->cmd_trash}] <!--@end-->
							<a href="{getUrl('', 'mid', $module_list[$val->module_srl]->mid)}" target="_blank">{$module_list[$val->module_srl]->browser_title}</a>
							<!--@if($document_list[$document_srl] && ($val->upload_target_type == 'doc' || $val->upload_target_type == 'com'))-->
							 - <!--@if($document_list[$document_srl]->get('module_srl') != $document_list[$document_srl]->get('member_srl'))--><a href="{$move_uri}" target="_blank">{$document_list[$document_srl]->getTitle()}</a><!--@else-->{$document_list[$document_srl]->getTitle()}<!--@end-->
							<!--@end-->
						<!--@end-->
					</th>
				</tr>
					<!--@endif-->
					<!-- one document end -->
				<tr>
					<td class="text"><a href="{$val->download_url}">{htmlspecialchars($val->source_filename)}</a></td>
					<td class="nowr">{FileHandler::filesize($val->file_size)}</td>
					<td class="nowr">{$val->download_count}</td>
					<td class="nowr">
						<!--@if($val->upload_target_type == 'doc' && $document_list[$document_srl])-->
						<a href="#popup_menu_area" class="member_{$document_list[$document_srl]->get('member_srl')}">{$document_list[$document_srl]->getNickName()}</a>
						<!--@elseif($val->upload_target_type == 'com' && $comment_list[$val->upload_target_srl])-->
						<a href="#popup_menu_area" class="member_{$comment_list[$val->upload_target_srl]->get('member_srl')}">{$comment_list[$val->upload_target_srl]->getNickName()}</a>
						<!--@end-->
					</td>
					<td class="nowr">{zdate($val->regdate,"Y-m-d H:i")}</td>
					<td class="nowr"><a href="{getUrl('search_target','ipaddress','search_keyword',$val->ipaddress)}">{$val->ipaddress}</a></td>
					<td class="nowr"><!--@if($val->isvalid=='Y')-->{$lang->is_valid}<!--@else-->{$lang->is_stand_by}<!--@end--></td>
					<td>
						<input type="checkbox" name="cart" value="{$val->file_srl}" />
					</td>
				</tr>
				<!--@endforeach-->
			</tbody>
		</table>
		<div class="btnArea">
			<span class="btn"><a href="#listManager" class="modalAnchor" onclick="getFileList();">{$lang->file_manager}...</a></span>
		</div>
	</div>
</form>
<div class="modal" id="listManager">
	<form ruleset="deleteChecked" action="./" method="post" class="fg form">
	<input type="hidden" name="module" value="file" />
	<input type="hidden" name="act" value="procFileAdminDeleteChecked" />
	<input type="hidden" name="page" value="{$page}" />
		<h2 class="h2">{$lang->file_manager}</h2>
		<div class="table">
			<table width="100%" border="1" cellspacing="0" id="fileManageListTable">
				<caption>{$lang->selected_file} <strong id="selectedFileCount"></strong></caption>
				<thead>
					<tr>
						<th scope="col" class="text">{$lang->file}</th>
						<th scope="col" class="nowr">{$lang->file_size}</th>
						<th scope="col" class="nowr">{$lang->status}</th>
					</tr>
				</thead>
				<tbody>
				</tbody>
			</table>
		</div>
		<div class="btnArea">
			<span class="btn"><input type="submit" value="{$lang->cmd_delete}" class="delete" /></span>
		</div>
	</form>
</div>
<div class="search">
<form action="" class="pagination">
	<input type="hidden" name="error_return_url" value="" />
	<input type="hidden" name="module" value="{$module}" />
	<input type="hidden" name="act" value="{$act}" />
  	<input cond="$search_keyword" type="hidden" name="search_keyword" value="{$search_keyword}" />
  	<input cond="$search_target" type="hidden" name="search_target" value="{$search_target}" />

	<a href="{getUrl('page', '')}" class="direction">&laquo; FIRST</a>
	<block cond="$page_navigation->first_page + $page_navigation->page_count > $page_navigation->last_page && $page_navigation->page_count != $page_navigation->total_page">
		{@$isGoTo = true}
		<a href="{getUrl('page', '')}">1</a>
		<a href="#goTo" class="tgAnchor" title="{$lang->cmd_go_to_page}">...</a>
	</block>
	<!--@while($page_no = $page_navigation->getNextPage())-->
		{@$last_page = $page_no}
		<strong cond="$page_no == $page">{$page_no}</strong>
		<a cond="$page_no != $page" href="{getUrl('page', $page_no)}">{$page_no}</a>
	<!--@end-->
	<block cond="$last_page != $page_navigation->last_page">
		{@$isGoTo = true}
		<a href="#goTo" class="tgAnchor" title="{$lang->cmd_go_to_page}">...</a>
		<a href="{getUrl('page', $page_navigation->last_page)}">{$page_navigation->last_page}</a>
	</block>
	<a href="{getUrl('page', $page_navigation->last_page)}" class="direction">LAST &raquo;</a>
	<span cond="$isGoTo" id="goTo" class="tgContent">
		<input name="page" title="{$lang->cmd_go_to_page}" />
		<button type="submit">Go</button>
	</span>
</form>

	<form action="./" method="get" onsubmit="return checkSearch(this)">
	<input type="hidden" name="module" value="{$module}" />
	<input type="hidden" name="act" value="{$act}" />
	<input type="hidden" name="module_srl" value="{$module_srl}" />
	<input type="hidden" name="error_return_url" value="" />
		<select name="search_target">
			<option value="">{$lang->search_target}</option>
			<!--@foreach($lang->file_search_target_list as $key => $val)-->
			<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
			<!--@end-->
		</select>
		<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" />
		<input type="submit" value="{$lang->cmd_search}" />
		<a href="{getUrl('','module',$module,'act',$act)}"><span>{$lang->cmd_cancel}</span></a>
	</form>
</div>
